﻿using PlayListSet.Comm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlayListSet.Entity
{
    public class ChannelInfo
    {
        [SqlSugar.SugarColumn(IsPrimaryKey = true,IsIdentity =true)]
        public int Id { get; set; }
        public string ChannelName { set; get; }
        public double SizeWidth { set; get; }
        public double SizeHeight { set; get; }
        public string IPEndPoint { set; get; }
        /// <summary>
        /// 0 播放资源 1 本地音乐 2 时间线指令
        /// </summary>
        public int ChannelType { set; get; }
        public static List<ChannelInfo> GetChannelInfos()
        {
            //var json = System.IO.File.ReadAllText(System.IO.Path.Combine(
            // System.AppDomain.CurrentDomain.BaseDirectory, "cfg", "ChannelInfos.json"));
            //return Newtonsoft.Json.JsonConvert.DeserializeObject<List<ChannelInfo>>(json); 
            var cfg = AppHelp.GetAppSqlSugarClient().Queryable<ChannelInfo>().ToList();
             if(cfg == null)
                return new List<ChannelInfo>();
            return cfg;
        }
    }
}
